home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / power games ii / tetrix / uedit / config!s < prev    next >
Text File  |  1994-05-20  |  13KB  |  328 lines

  1. ======== SPELLING CMDS ======
  2.  
  3. Start spell-checking mode by loading in the dictionary table.
  4. <rAmiga-1:  if (spellerUp) goto label(0)
  5.             if (not startSpell("Udtable","Udict",1)) {
  6.                 putMsg("No memory or dictionary not found")
  7.                 returnFalse
  8.             }
  9.             label(0)
  10.             putMsg("Speller is up") >
  11.  
  12. Find first misspelled word, starting at cursor.  Abort with Amiga-ESC.
  13. <rAmiga-2:      if (not spellerUp) {
  14.                     putMsg("Speller not up")
  15.                     returnFalse
  16.                 }
  17.                 putMsg(" ")
  18.                 if (not spell(curFile)) putMsg("Not in dict.") >
  19.  
  20. Spell-check from cursor fwd.  Mark bad words with "@".
  21. <rAmiga-3:      if (not runKey(rAmiga-1)) returnFalse
  22.                 putMsg("Spell checking ... abort with Amiga-ESC")
  23.                 while (not spell(curFile)) insertChar(curFile,"@") >
  24.  
  25. Force file saving to finish so buffer is unlocked
  26. <104:
  27. label(99)
  28.                     getStackSize(n99,n99,n98)
  29.                     if (gtNum(n98,0)) { delay(5) goto label(99) } >
  30.  
  31. Load supplemental dictionary & spell from cursor fwd.  Add to supplement.
  32. <rAmiga-4:   if (not runKey(rAmiga-1)) returnFalse
  33.              equateNum(n54,curFile)
  34.              putMsg("Dict supplement to use (pmESC = UdSupplement)")
  35.              freebuf(buf54)
  36.              equateNum(n99,0)
  37.              if (inputString(buf54))  {
  38.                 if (not loadFile(buf54)) goto label(3)
  39.              } else {
  40. label(3)
  41.                 if (not loadFile("UdSupplement")) {
  42.                     if (not newFile) {
  43.                         putMsg("Close a file for me!")
  44.                         returnFalse
  45.                     }
  46.                     setFileName(curfile,"UdSupplement")
  47.                 }
  48.              }
  49.              putMsg("Spell checking ... abort with Amiga-ESC")
  50.              if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  51. label(0)
  52.              while (not spell(buf[n54])) {
  53.                 moveCursor(buf[n54],sWord)
  54.                 freeBuf(buf54)
  55.                 insertRgn(buf54,eFile,buf[n54],word)
  56.                 moveCursor(buf[n54],eWord)
  57.                 moveCursor(buf54,sFile)
  58.                 if (not is(buf54,"'")) if (not is(buf54,alpha)) goto label(0)
  59.                 moveCursor(buf54,eFile)
  60.                 
  61.                 putMsg(buf54)                 .. remove for faster speed
  62.                 
  63.                 insertChar(buf54,eLine)
  64.                 moveCursor(curFile,eFile)
  65.  
  66. label(4)        .. could remove this block but it helps hugely in speed.
  67.                 setSearch(buf54)
  68.                 if (search(curFile,locA,locB,-1)) {
  69.                     if (is(curFile,sWord)) goto label(0)
  70.                     moveCursor(curFile,sWord)
  71.                     goto label(4)
  72.                 }
  73.                 moveCursor(buf54,sChar)
  74.                 clearChar(buf54) .. remove eline
  75.                 
  76.                 ..  this sect for speed
  77.                 moveCursor(buf54,sFile)
  78.                 copyChar(buf54,n47)      .. copy 1st char of word
  79.                 freeBuf(buf52)
  80.                 insertChar(buf52,eLine)  .. load in eline-1stchar
  81.                 insertChar(buf52,n47)
  82.                 moveCursor(curFile,eFile).. search for starting place
  83.                 setSearch(buf52)
  84.                 search(curfile,locA,locB,-1)
  85.                 moveCursor(curFile,eWord).. move fwd, so sWord works
  86.                 
  87.                 if (is(curFile,sFile)) goto label(1)
  88.                 while (nothing) {
  89.                     moveCursor(curFile,sWord)
  90.                     freeBuf(buf53)
  91.                     insertRgn(buf53,eFile,curFile,word)
  92.                     stringComp(n53,buf54,buf53,1)       .. ignore case
  93.                     if (eqNum(n53,0)) goto label(0)     .. found it, continue
  94.                     if (gtNum(n53,0)) {
  95. label(1)
  96.                         moveCursor(curFile,eWord)
  97.                         moveCursor(curFile,eChar)
  98. label(2)
  99.                         insertRgn(curFile,atCursor,buf54,all)
  100.                         insertChar(curFile,eLine)
  101.                         updateDisplay                 .. remove for faster speed
  102.                         incNum(n99)
  103.                         if (gtNum(n99,19)) {
  104.                             fileSize(curFile,n99)  .. force buffer packing
  105.                             equateNum(n99,0)
  106.                         }
  107.                         goto label(0)
  108.                     }
  109.                     if (is(curFile,sFile)) goto label(2)
  110.                 }
  111.             }
  112.             moveCursor(curFile,sFile)
  113.             putMsg("These words weren't in dictionary")
  114.             .. stopSpell       .. use if want speller removed
  115.             >
  116.  
  117. Merge dict supplement with dict-files.  dict.A-Z must be in Current Directory.
  118. <rAmiga-5:  if (isEmpty(curFile)) returnFalse
  119.             moveCursor(curFile,sFile)
  120.             freeBuf(buf52)
  121.             freeBuf(buf54)
  122.             insertRgn(buf54,eFile,"dh0:spell/private/dict. ",all)
  123.             if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  124.             equateNum(n50,0)
  125.             while (nothing) {
  126.                 moveCursor(curFile,eWord)
  127.                 moveCursor(curFile,sWord)
  128.                 freeBuf(buf53)
  129.                 if (not insertRgn(buf53,eFile,curFile,word)) {
  130. label(6)
  131.                         if (getFlag(buf52,changed)) saveFile(buf52)
  132.                         runKey(104) .. force save to complete
  133.                         goto label(0)
  134.                 }
  135.                 moveCursor(buf53,sFile)
  136.                 toUpper(buf53)
  137.                 copyChar(buf53,n54)   .. copy 1st letter of word A-Z
  138.                 toLower(buf53)
  139.                 if (eqNum(n54,39)) equateNum(n54,65)  .. apost becomes 'A'
  140.                 else {
  141.                     if (gtNum(n54,90)) goto label(1)  .. must be A-Z
  142.                     if (gtNum(65,n54)) goto label(1)
  143.                 }
  144.                 moveCursor(buf54,eFile)
  145.                 moveCursor(buf54,sChar)
  146.                 swapChar(buf54,n54) .. make it "dict.A" etc.
  147.                 
  148.                 if (not eqNum(n54,n50)) {
  149.                     if (not eqNum(n50,0)) 
  150.                         if (getFlag(buf52,changed)) saveFile(buf52)
  151.                     runKey(104) .. force save to complete
  152.                     clearRgn(buf52,all)
  153.                     fileSize(buf52,n49) .. make it pack buffer
  154.                     if (not insertFile(buf52,eFile,buf54)) {
  155.                     putMsg("Can't find dict.A-Z!")
  156.                         returnFalse
  157.                     }
  158.                     setFileName(buf52,buf54)
  159.                     if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  160.                     equateNum(n50,n54)  .. save dict-letter
  161.                 }
  162.                 .. put word in dict.
  163.                 moveCursor(buf53,eFile)
  164.                 putMsg(buf53)
  165.                 insertChar(buf53,eLine)
  166.                 moveCursor(buf52,eFile)
  167. label(2)
  168.                 setSearch(buf53)
  169.                 if (search(buf52,locA,locB,-1)) {
  170.                     if (is(buf52,sWord)) goto label(1)
  171.                     goto label(2) .. continue searching
  172.                 }
  173.                 .. didn't find it.  Do the slow scan & insert the word.
  174.                 moveCursor(buf53,eFile)
  175.                 moveCursor(buf53,sChar)
  176.                 clearChar(buf53) .. remove eLine
  177.                 moveCursor(buf52,eFile)
  178.                 equateNum(n49,1)
  179. label(4)
  180.                 while (nothing) {
  181.                     if (eqNum(n49,1)) do(n48,1,40) moveCursor(buf52,sWord)
  182.                     moveCursor(buf52,sWord)
  183.                     freeBuf(buf51)
  184.                     insertRgn(buf51,eFile,buf52,word)
  185.                     stringComp(n53,buf53,buf51,1)       .. ignore case
  186.                     if (eqNum(n53,0)) goto label(1)     .. found it, continue
  187.                     if (gtNum(n53,0)) {
  188.                         if (eqNum(n49,1)) goto label(5)
  189.                         moveCursor(buf52,eWord)
  190.                         moveCursor(buf52,eChar)
  191. label(3)
  192.                         insertRgn(buf52,atCursor,buf53,all)
  193.                         insertChar(buf52,eLine)
  194.                         goto label(1)
  195.                     }
  196.                     if (is(buf52,sFile)) {
  197.                         if (eqNum(n49,1)) {
  198. label(5)
  199.                             equateNum(n49,0)
  200.                             do (n48,1,41) moveCursor(buf52,eWord)
  201.                             goto label(4)
  202.                         }
  203.                         goto label(3)
  204.                     }
  205.                 }
  206.  
  207. label(1) .. next word
  208.                 moveCursor(curFile,eLine)
  209.                 moveCursor(curFile,eChar)
  210.                 updateDisplay
  211.                 if (is(curFile,eFile)) goto label(6)
  212.             }
  213. label(0)
  214.             putMsg("Done.  Run Udbuild to rebuild working dict & table")
  215.             freeBuf(buf52)
  216. >
  217.  
  218. Remove words from dict-files.  dict.A-Z must be in Current Directory.
  219. <rAmiga-6:  if (isEmpty(curFile)) returnFalse
  220.             moveCursor(curFile,sFile)
  221.             freeBuf(buf52)
  222.             freeBuf(buf54)
  223.             insertRgn(buf54,eFile,"dicts/dict. ",all)
  224.             if (getFlag(curFile,searchCaps)) flipFlag(curFile,searchCaps)
  225.             equateNum(n50,0)
  226.             while (nothing) {
  227.                 moveCursor(curFile,eWord)
  228.                 moveCursor(curFile,sWord)
  229.                 freeBuf(buf53)
  230.                 if (not insertRgn(buf53,eFile,curFile,word)) {
  231. label(6)
  232.                         if (getFlag(buf52,changed)) saveFile(buf52)
  233.                         runKey(104) .. force save to complete
  234.                         goto label(0)
  235.                 }
  236.                 moveCursor(buf53,sFile)
  237.                 toUpper(buf53)
  238.                 copyChar(buf53,n54)   .. copy 1st letter of word A-Z
  239.                 toLower(buf53)
  240.                 if (eqNum(n54,"'")) equateNum(n54,"A")  .. apost becomes 'A'
  241.                 else {
  242.                     if (gtNum(n54,"Z")) goto label(1)  .. must be A-Z
  243.                     if (gtNum(65,n54)) goto label(1)
  244.                 }
  245.                 moveCursor(buf54,eFile)
  246.                 moveCursor(buf54,sChar)
  247.                 swapChar(buf54,n54) .. make it "dict.A" etc.
  248.                 
  249.                 if (not eqNum(n54,n50)) {
  250.                     if (not eqNum(n50,0)) 
  251.                         if (getFlag(buf52,changed)) saveFile(buf52)
  252.                     runKey(104) .. force save to complete
  253.                     clearRgn(buf52,all)
  254.                     fileSize(buf52,n49) .. make it pack buffer
  255.                     if (not insertFile(buf52,eFile,buf54)) {
  256.                         putMsg("Can't find dict.A-Z!")
  257.                         returnFalse
  258.                     }
  259.                     setFileName(buf52,buf54)
  260.                     if (getFlag(buf52,changed)) flipFlag(buf52,changed)
  261.                     equateNum(n50,n54)  .. save dict-letter
  262.                 }
  263.                 .. remove word from dict.
  264.                 moveCursor(buf53,eFile)
  265.                 putMsg(buf53)
  266.                 insertChar(buf53,eLine)
  267.                 moveCursor(buf52,eFile)
  268. label(2)
  269.                 setSearch(buf53)
  270.                 if (search(buf52,locA,locB,-1)) {
  271.                     if (is(buf52,sWord)) {
  272.                         clearRgn(buf52,loc)
  273.                         goto label(1) .. next word
  274.                     }
  275.                     goto label(2) .. continue searching
  276.                 }
  277.  
  278. label(1) .. next word
  279.                 moveCursor(curFile,eLine)
  280.                 moveCursor(curFile,eChar)
  281.                 if (is(curFile,eFile)) goto label(6)
  282.                 updateDisplay
  283.             }
  284. label(0)
  285.             putMsg("Done.  Run Udbuild to rebuild working dict & table")
  286.             freeBuf(buf52)
  287. >
  288.  
  289. Stop spell-checking mode.  (Frees up about 12k of memory.)
  290. <rAmiga-8:   if (spellerUp) { stopSpell putMsg("Speller removed") } >
  291.  
  292. ========== Split Windows =========
  293.  
  294. Remove current split window
  295. <lAmiga-0:  splitWindow(curFile,0)>
  296.  
  297. Split window to show current file
  298. <lAmiga-c:  splitWindow(curFile,splitSize)>
  299.  
  300. Split window to show Undo buffer
  301. <lAmiga-1:  splitWindow(buf45,splitSize)>
  302.  
  303. Split window to show search buffer
  304. <lAmiga-2:  splitWindow(buf49,splitSize)>
  305.  
  306. Split window to show replace buffer
  307. <lAmiga-3:  splitWindow(buf48,splitSize)>
  308.  
  309. Split window to show copied-hilite buffer
  310. <lAmiga-4:  splitWindow(buf47,splitSize)>
  311.  
  312. Split window to show copied-invert buffer
  313. <lAmiga-5:  splitWindow(buf46,splitSize)>
  314.  
  315. Split window to show copied-columnar buffer
  316. <lAmiga-6:  splitWindow(buf37,splitSize)>
  317.  
  318. Split window to show directory names
  319. <lAmiga-7:  splitWindow(buf38,splitSize) >
  320.  
  321. Set split window size
  322. <lAmiga-8: putMsg("# lines in split window (2 or more):")
  323.            if (inputNum(n54)) if (geNum(n54,2)) equateNum(splitSize,n54)
  324.            putMsg(" ")>
  325. Switch to next window split
  326. <lAmiga-9: toggle(windowSplit)>
  327.  
  328.